<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>if-else</title>
</head>
<body>
<div id="app">
    <h1 v-if="ok">yes</h1>
    <h1 v-else>no</h1>
</div>

<div id="app2">
    <h1 v-if="type==='a'">A</h1>
    <h1 v-else-if="type==='b'">B</h1>
    <h1 v-else-if="type==='d'">D</h1>
    <h1 v-else>C</h1>
</div>

<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<script>
    var app = new Vue({
        el: "#app",
        data: {     // model层 数据
            ok: false
        }
    });

    var app2 = new Vue({
        el: "#app2",
        data: {
            type: 'a'
        }
    });
</script>
</body>
</html>
